package com.cheng.im.service.user.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * im模块的im用户表
 * @TableName im_user_data
 */
@TableName(value ="im_user_data")
@Data
public class ImUserData implements Serializable {
    /**
     * 主键（应该是雪花id）
     */
    @TableId
    private String userId;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 位置
     */
    private String location;

    /**
     * 密码
     */
    private String password;

    /**
     * 头像
     */
    private String photo;

    /**
     * 用户性别（0女，1男）
     */
    private Integer sex;

    /**
     * 个性签名
     */
    private String selfSignature;

    /**
     * 加好友类型（0不需要验证，1需要验证）
     */
    private Integer friendAllowType;

    /**
     * 管理员禁止用户添加加好友：0 未禁用 1 已禁用
     */
    private Integer disableAddFriend;

    /**
     * 禁用标识(0 未禁用 1 已禁用)
     */
    private Integer forbiddenFlag;

    /**
     * 禁言标识(0 未禁用 1 已禁用)
     */
    private Integer silentFlag;

    /**
     * 用户类型 1普通用户 2客服 3机器人
     */
    private Integer userType;

    /**
     * 在线状态（0不在线，1在线）
     */
    private Integer activeStatus;

    /**
     * 应用的appid
     */
    private String appId;

    /**
     * (0 未删除 1 已删除)
     */
    private Integer delFlag;

    /**
     * 额外信息
     */
    private String extra;

    /**
     * 最后一次登录时间
     */
    private Long lastLoginTime;

    /**
     * ip信息
     */
    private Object ipInfo;

    /**
     * 创建时间
     */
    private Long createTime;

    /**
     * 更新时间
     */
    private Long updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ImUserData other = (ImUserData) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getNickName() == null ? other.getNickName() == null : this.getNickName().equals(other.getNickName()))
            && (this.getLocation() == null ? other.getLocation() == null : this.getLocation().equals(other.getLocation()))
            && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword()))
            && (this.getPhoto() == null ? other.getPhoto() == null : this.getPhoto().equals(other.getPhoto()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getSelfSignature() == null ? other.getSelfSignature() == null : this.getSelfSignature().equals(other.getSelfSignature()))
            && (this.getFriendAllowType() == null ? other.getFriendAllowType() == null : this.getFriendAllowType().equals(other.getFriendAllowType()))
            && (this.getDisableAddFriend() == null ? other.getDisableAddFriend() == null : this.getDisableAddFriend().equals(other.getDisableAddFriend()))
            && (this.getForbiddenFlag() == null ? other.getForbiddenFlag() == null : this.getForbiddenFlag().equals(other.getForbiddenFlag()))
            && (this.getSilentFlag() == null ? other.getSilentFlag() == null : this.getSilentFlag().equals(other.getSilentFlag()))
            && (this.getUserType() == null ? other.getUserType() == null : this.getUserType().equals(other.getUserType()))
            && (this.getActiveStatus() == null ? other.getActiveStatus() == null : this.getActiveStatus().equals(other.getActiveStatus()))
            && (this.getAppId() == null ? other.getAppId() == null : this.getAppId().equals(other.getAppId()))
            && (this.getDelFlag() == null ? other.getDelFlag() == null : this.getDelFlag().equals(other.getDelFlag()))
            && (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
            && (this.getLastLoginTime() == null ? other.getLastLoginTime() == null : this.getLastLoginTime().equals(other.getLastLoginTime()))
            && (this.getIpInfo() == null ? other.getIpInfo() == null : this.getIpInfo().equals(other.getIpInfo()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getNickName() == null) ? 0 : getNickName().hashCode());
        result = prime * result + ((getLocation() == null) ? 0 : getLocation().hashCode());
        result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode());
        result = prime * result + ((getPhoto() == null) ? 0 : getPhoto().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getSelfSignature() == null) ? 0 : getSelfSignature().hashCode());
        result = prime * result + ((getFriendAllowType() == null) ? 0 : getFriendAllowType().hashCode());
        result = prime * result + ((getDisableAddFriend() == null) ? 0 : getDisableAddFriend().hashCode());
        result = prime * result + ((getForbiddenFlag() == null) ? 0 : getForbiddenFlag().hashCode());
        result = prime * result + ((getSilentFlag() == null) ? 0 : getSilentFlag().hashCode());
        result = prime * result + ((getUserType() == null) ? 0 : getUserType().hashCode());
        result = prime * result + ((getActiveStatus() == null) ? 0 : getActiveStatus().hashCode());
        result = prime * result + ((getAppId() == null) ? 0 : getAppId().hashCode());
        result = prime * result + ((getDelFlag() == null) ? 0 : getDelFlag().hashCode());
        result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
        result = prime * result + ((getLastLoginTime() == null) ? 0 : getLastLoginTime().hashCode());
        result = prime * result + ((getIpInfo() == null) ? 0 : getIpInfo().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", nickName=").append(nickName);
        sb.append(", location=").append(location);
        sb.append(", password=").append(password);
        sb.append(", photo=").append(photo);
        sb.append(", sex=").append(sex);
        sb.append(", selfSignature=").append(selfSignature);
        sb.append(", friendAllowType=").append(friendAllowType);
        sb.append(", disableAddFriend=").append(disableAddFriend);
        sb.append(", forbiddenFlag=").append(forbiddenFlag);
        sb.append(", silentFlag=").append(silentFlag);
        sb.append(", userType=").append(userType);
        sb.append(", activeStatus=").append(activeStatus);
        sb.append(", appId=").append(appId);
        sb.append(", delFlag=").append(delFlag);
        sb.append(", extra=").append(extra);
        sb.append(", lastLoginTime=").append(lastLoginTime);
        sb.append(", ipInfo=").append(ipInfo);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}